#!/usr/bin/python
# coding=utf-8
# Filename: function.py

#import RPi.GPIO as GPIO


def turn(direction):
    if direction == 1:
        # 向前
        print("Forward")
    elif direction == 2:
        # 向右
        print("Right")
    elif direction == 3:
        # 向下
        print("Back")
    elif direction == 4:
        # 向左
        print("Left")
    else:
        print("Error")


#设置管脚编号标准
# GPIO.setmode(GPIO.BOARD)
#禁用警告
# GPIO.setwarnings(False)

#设置管脚输入还是输出
# GPIO.setup(channel, GPIO.IN)
# GPIO.setup(channel, GPIO.OUT)
#输出的时候，设置初始电平
# GPIO.setup(channel, GPIO.OUT, initial=GPIO.HIGH)

#获取输入管脚的电平
# GPIO.input(channel)
#设置输出管脚的电平
# GPIO.output(channel, state)

#清理管脚状态
# GPIO.cleanup()